﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using MediaLibraryManagement.Entity;
using MediaLibraryManagement.Common;

namespace MediaLibraryManagement.UI
{
    public partial class ArtistInfoPane : UserControl
    {
        private Artist _artist;

        public Artist Artist
        {
            get { return _artist; }
            set { _artist = value; }
        }

        public ArtistInfoPane()
        {
            InitializeComponent();
        }

        private void ArtistInfoPane_Load(object sender, EventArgs e)
        {
            if(_artist != null)
            {
                lblName.Text += (_artist.FirstName + " " + _artist.LastName).Trim();
                lblDateOfBirth.Text += _artist.DateOfBirth.ToString("dd/MM/yyyy");
                lblCountry.Text += _artist.Country;
                picArtistImage.Image = Utilities.ScaleImage(_artist.Image, picArtistImage.Width, picArtistImage.Height);
            }
        }

        private void lnkViewDetails_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            if(_artist != null)
            {
                ArtistDetails frmArtistDetails = new ArtistDetails(_artist);
                frmArtistDetails.ShowDialog();
            }
        }
    }
}
